package com.example.javabasic.thread.classtwo.lock.demo1;
//读操作
public class ReaderWorker extends Thread{
    private final ShareData data;

    public ReaderWorker(ShareData data) {
        this.data = data;
    }

    @Override
    public void run() {

        try{
            while(true){
                char[] readerBuf =data.read();
                System.out.println(Thread.currentThread().getName()+":  "+String.valueOf(readerBuf));
            }
        }catch(InterruptedException e) {

        }
    }
}
